import 'package:acgn_pioneer/event/model_event.dart';

import '../global/_index.dart';

/// 错误编码
class ApiCode {
  /// 网络错误
  static const NETWORK_ERROR = -1;

  /// 网络超时
  static const NETWORK_TIMEOUT = -2;

  /// 网络返回数据格式化一次
  static const NETWORK_JSON_EXCEPTION = -3;

  static const SUCCESS = 200;

  static errorHandleFunction(code, message, noTip) {
    if (noTip) {
      return;
    }
    ACGN.event.fire(new HttpErrorEvent(code, message));
  }
}
